import request from '@/http';

export interface Tag {
  id: number;
  name: string;
}

export const tagService = {
  // 获取所有标签
  getTags: async (): Promise<Tag[]> => {
    const response = await request.get<Tag[]>('/api/tags/');
    return response.data.data;
  },

  // 添加新标签
  addTag: async (name: string): Promise<Tag> => {
    const response = await request.post<Tag>('/api/tags/', { name });
    return response.data.data;
  }
}; 